﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <form id="accountSettingsForm" action="/Account/AccountSettings" method="post">
    <div class="why">
        <div class="why_l">
            <ul class="why_l_a">
                <li><strong>Your Account</strong></li>
                <li>Account Settings</li>
                <li><a href="/Account/Personalisation">Personalisation</a></li>
                <li><a href="/Account/EmailPreferences">Email Preferences</a></li>
                <li><a href="/Account/TrainingReminders">Training Reminders</a></li>
                <li><a href="/Account/ChangePassword">Change Password</a></li>
                <li></li>
            </ul>
        </div>
        <div class="latest_r">
            <b class="application_t"><b class="application_tl"></b><b class="application_tr"></b>
            </b><b class="password_c">
                <h1 class="password_h1">
                    Account Settings
                    <p>
                        <label>
                            Username:</label>
                        <%=(Session["User"] as CognisessDA.User).Username %></p>
                    <p>
                        <label>
                            Email address:</label><%=(Session["User"] as CognisessDA.User).Email %></p>
                    <p>
                        <a href="#" onclick="showLoginArea();">Update account information</a></p>
                </h1>
                <div class="password_new" id="AccountSettings">
                    <ul>
                        <li>
                            <label>
                                UserName:</label><input name="newUserName" type="text" id="newUserName" class="textarea"
                                    value="" size="40" /></li>
                        <li>
                            <label>
                                EmailAddress:</label><input name="emailAddress" type="text" id="emailAddress" class="textarea"
                                    value="" size="40" /></li>
                        <li>
                            <label>
                                &nbsp;</label><input class="password_new_input" type="submit" name="button2" id="button2"
                                    value="" /></li>
                    </ul>
                </div>
                <h2 class="account_h2">
                    Membership Details
                    <p>
                        <label>
                            Current Plan:</label>
                        Free Trial or Cognidrive</p>
                    <p>
                        <label>
                            &nbsp;</label>
                        Premium Trial Ends on 2011-03-12.</p>
                </h2>
                <span class="account_button">
                    <input type="button" name="button" id="button" onclick="javascript:window.location.href='/Account/StartCognidrive'"/>
                </span></b><b class="review_lf_d"><b class="review_lf_dl"></b><b class="review_lf_dr">
                </b></b>
        </div>
    </form>
    <style type="text/css">
        .error
        {
            text-align: left;
            color: Red;
        }
    </style>

    <script language="javascript" type="text/javascript">
//        $.validator.setDefaults({
//            debug: true
//        });
        $(".password_new").hide();
        $().ready(function() {
            $("#accountSettingsForm").validate({
                rules: {
                    newUserName: { required: true, rangelength: [6, 12] },
                    emailAddress: { required: true, email: true }
                },
                messages: {
                    newUserName: { required: "Please enter your User Name.", rangelength: "User Name must be in 6-12 between characters." },
                    emailAddress: { required: "Please enter your Email Address.", email: "Please enter a valid E-mail address formats." }
                }
            });
        });

        

        function hideLoginArea() {
            $(".password_new").find(".textarea").val("");
            $(".password_new").hide();
            $("label[class='error']").remove();
        };

        function showLoginArea() {
            $(".password_new").show();
      
        };
    </script>

</asp:Content>
